package vmcs.simulationsystem;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import vmcs.controller.TransactionController;

public class TerminateButtonListener implements ActionListener{

private TransactionController transactionController;

/**
*  This constructor creates an instance of the Terminate Button Listener. It
*  receives the reference for the Transaction Controller object as a parameter.
* @param tCtrl Transaction Controller
* @see TransactionController
*/     
    public TerminateButtonListener(TransactionController tCtrl) {
    	transactionController = tCtrl;
    }

/**
* Invoked when an action occurs in response to the button being pressed. 
* Implemented as a part of interface.
* @param e ActionEvent 
* @see TransactionController#cancelTransaction()
*/     
    public void actionPerformed(ActionEvent e) {
    	transactionController.cancelTransaction();  
    }
}

